package com.ruoyi.iot.service.impl;

import java.util.List;

import cn.hutool.core.util.IdUtil;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.iot.mapper.FacDevicesTypeMapper;
import com.ruoyi.iot.domain.FacDevicesType;
import com.ruoyi.iot.service.IFacDevicesTypeService;

/**
 * 设备型号Service业务层处理
 * 
 * @author rww
 * @date 2024-06-18
 */
@Service
public class FacDevicesTypeServiceImpl implements IFacDevicesTypeService 
{
    @Autowired
    private FacDevicesTypeMapper facDevicesTypeMapper;

    /**
     * 查询设备型号
     * 
     * @param id 设备型号主键
     * @return 设备型号
     */
    @Override
    public FacDevicesType selectFacDevicesTypeById(Long id)
    {
        return facDevicesTypeMapper.selectFacDevicesTypeById(id);
    }

    /**
     * 查询设备型号列表
     * 
     * @param facDevicesType 设备型号
     * @return 设备型号
     */
    @Override
    public List<FacDevicesType> selectFacDevicesTypeList(FacDevicesType facDevicesType)
    {
        return facDevicesTypeMapper.selectFacDevicesTypeList(facDevicesType);
    }

    /**
     * 新增设备型号
     * 
     * @param facDevicesType 设备型号
     * @return 结果
     */
    @Override
    public int insertFacDevicesType(FacDevicesType facDevicesType)
    {
        facDevicesType.setId(IdUtil.getSnowflakeNextId());
        facDevicesType.setCreateTime(DateUtils.getNowDate());
        return facDevicesTypeMapper.insertFacDevicesType(facDevicesType);
    }

    /**
     * 修改设备型号
     * 
     * @param facDevicesType 设备型号
     * @return 结果
     */
    @Override
    public int updateFacDevicesType(FacDevicesType facDevicesType)
    {
        return facDevicesTypeMapper.updateFacDevicesType(facDevicesType);
    }

    /**
     * 批量删除设备型号
     * 
     * @param ids 需要删除的设备型号主键
     * @return 结果
     */
    @Override
    public int deleteFacDevicesTypeByIds(Long[] ids)
    {
        return facDevicesTypeMapper.deleteFacDevicesTypeByIds(ids);
    }

    /**
     * 删除设备型号信息
     * 
     * @param id 设备型号主键
     * @return 结果
     */
    @Override
    public int deleteFacDevicesTypeById(Long id)
    {
        return facDevicesTypeMapper.deleteFacDevicesTypeById(id);
    }
}
